<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml">


	<ui:define name="body">
		<h:form>
			<h:messages globalOnly="true" styleClass="message" />
			<s:button action="#{subjectaction.edit}" value="New">
			</s:button>
			<h:panelGrid columns="2" width="100%" columnClasses="col1,col2">
				<rich:tree id="maintree" style="width:300px" 
					reRender="selectedNode,todos,mylogs" ajaxSubmitSelection="true"
					switchType="client"  value="#{rootNode}" var="item"
					nodeSelectListener="#{subjectaction.processSelection}">

				</rich:tree>
				<h:panelGroup>
					<h:panelGrid columns="1">
						<h:outputText escape="false" value="Selected Node: #{curSubject}"
							id="selectedNode" />
						<s:button value="Add Todo" action="#{todoaction.editSubjectTodo}"></s:button>
						<s:button value="Add Log" action="#{mylogaction.editSubjectLog}"></s:button>

					</h:panelGrid>
				</h:panelGroup>

				<rich:dataTable id="todos" value="#{curTodos}" var="mytodo" rows="8">
					<rich:column>
						<f:facet name="header">Name</f:facet>
			#{mytodo.name}
			</rich:column>
					<rich:column>
						<f:facet name="header">Content</f:facet>
						<s:formattedText value="#{mytodo.content}" />
					</rich:column>

				</rich:dataTable>

				<rich:dataTable id="mylogs" value="#{curLogs}" var="mylog" rows="8">
					<rich:column>
						<f:facet name="header">Name</f:facet>
			#{mylog.name}
			</rich:column>
					<rich:column>
						<f:facet name="header">Content</f:facet>
						<s:formattedText value="#{mylog.content}" />
					</rich:column>

				</rich:dataTable>
			</h:panelGrid>
		</h:form>

	</ui:define>


</ui:composition>
